<html>
<head><meta charset="utf-8"><title>asm! register filter · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/asm!.20register.20filter.html">asm! register filter</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="248462999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/asm%21%20register%20filter/near/248462999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Scott Mabin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/asm!.20register.20filter.html#248462999">(Aug 05 2021 at 11:08)</a>:</h4>
<p>I am implementing the new asm! syntax for the Xtensa arch, and I am at the point where I will be filtering out registers based on target features. In my testing, it seems the filtering done in <code>def_regs!</code> macro doesn't seem to do anything. The asm is always passed down to llvm where it then errors. See this example in x86: <a href="https://godbolt.org/z/arxon3qzq">https://godbolt.org/z/arxon3qzq</a> - it should print <code>"register is only available on x86_64"</code> but it instead prints the llvm message instead.</p>
<p>My question is if this does nothing, then should I bother implementing the filters? Is this a bug?</p>
<p>cc <strong>Amanieu</strong> the asm! expert :)</p>



<a name="248466515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/asm%21%20register%20filter/near/248466515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/asm!.20register.20filter.html#248466515">(Aug 05 2021 at 11:52)</a>:</h4>
<p>We don't process the asm text at all. We only handle registers specified in input/output operands.</p>



<a name="248467105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/asm%21%20register%20filter/near/248467105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Scott Mabin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/asm!.20register.20filter.html#248467105">(Aug 05 2021 at 11:59)</a>:</h4>
<p>ah, that makes a lot more sense - still getting used to the new syntax! Specifying the correct registers I now get the Rust error. Thanks!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>